Prerequisites
Make sure you have the following installed on your machine before proceeding with the installation.
- Node.js (v16 or later)
- MongoDB Atlas Account
- Set Up a New Database Cluster
- Get the DB Connection String
- Create a new account on UploadThing
- Create a Project
- Get API Key/secret
Env variables
Make sure you have required environment variables set up before starting the server.
- GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
- Nodemailer Email and Password
- SMTP_EMAIL - Your email address
- SMTP_PASSWORD - From your google account, create an app password for nodemailer
- DATABASE_URL - MongoDB Connection String
- UPLOADTHING_SECRET - UploadThing API Secret
- UPLOADTHING_APP_ID - UploadThing App ID
- NEXTAUTH_SECRET - A random string for NextAuth
- BASE_API_URL - The base URL of the API
Example:
http://localhost:3000/api/graphql
- Clone the repository
Alternatively, you can download the repository as a zip file
git clone https://github.com/TechAtikiN/athena-ebooks
- Install dependencies
Note: This project uses
yarn
as the package manager.
cd athena-ebooks
yarn
-
Duplicate the information from the .env.example file into a new file named .env in the root directory and add the required values.
-
Start the server
yarn dev
The server will start at
http://localhost:3000
Apollo Server provides a GraphQL playground for testing the API.
It can be accessed at http://localhost:3000/api/graphql
The database schema documentation can be found in the SCHEMA.md file.