This Rails app was designed to handle the database and API for Good Reader, a reading organizer that places books into three categories. Books placed in any of the three lists are persisted in the database. Enjoy your read!
This app was created by running rails new gr-backedn --api --database=postgresql
, which prepared the application to perform as an API and to be configured for postgreSQL databases.
To get started with this application, fork and clone the repository to your hard drive. CD
into the project folder and run bundle install
. Once the gems have been installed, run rails db:create
to establish the database. Make sure you have postgreSQL installed and already running. Next, run rails db:migrate
to build your database tables and relationship. Run rails start
once the database has been set up to host the backend on your local server. If you're hosting both the front-end and back-end applications locally, also make sure you change the necessary URL variables in the React application so that changes will reflect your personal database.
There are three models that Good Reader utilizes:
The List
model belongs a User. When a user account is created, the three default lists of "Read", "Currently Reading", and "Want to Read" are also created attached to that particular user.
The Book
model hold all the data related to all books saved to a list.
The User
model handles all aspects of user accounts, including login/signup. Although bcrypt is in the gemfile, there is no password encryption in the app. Additionally, when a user is created, default lists are also created an attached.
Adding password encryption and handling sessions with JSON Web Tokens.