![Logo](https://github.com/Lindsay-Renna/lindsay-renna-capstone-api/raw/main/assets/famtivity-logo.png)
FamTivity is an innovative web application designed to help families plan custom family nights based on their preferences, the number of children, and their ages. This project aims to bring families closer by providing tailored activity suggestions that cater to the unique dynamics of each family.
This is the backend server that supports the front-end application found at lindsay-renna-capstone
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This app is designed for:
- Families with children of various ages seeking to enhance their quality time together.
- Parents looking for easy and convenient ways to plan engaging activities.
- Caregivers and educators interested in structured yet fun family activities.
- User registration and authentication
- User maintained WatchList to remove watched movies from future results
- Top 10 / popular movie/videogame/board games for families
- Client: React
- Server: Node, Express
- Database: MySQL
- Authentication: OAuth, Passport.js
- APIs: Movie and Video Game APIs for data retrieval, custom boardgame API using MySQL database
Authentication GET /auth/github - Initiates GitHub OAuth authentication GET /auth/github/callback - Handles the callback from GitHub after authentication.
GET /auth/google - Initiates Google OAuth authentication GET /auth/google/callback - Handles the callback from Google after authentication
GET /auth/profile - Retrieves the authenticated user's profile information GET /auth/logout - Logs out the authenticated user
User Profile GET /users/:userId/watched-list - Retrieves the list of watched movies for a specific user POST /users/watched-list/add - Adds a movie to the user's watched list DELETE /users/:movieId - Removes a movie from the user's watched list
Boardgames GET /boardgames - Get first 40 boardgames GET /boardgames/popular - Get listing of popular boardgames for families GET /boardgames/id - Get boardgame details by boardgame ID POST /boardgames/results - Return a result of boardgames matching query params (Expand this section with more details about each endpoint as needed)
To get a local copy up and running follow these simple steps:
- Node.js (>=14.x.x)
- git
- MySQL
-
Clone the repo
git clone https://github.com/lindsay-renna/lindsay-renna-capstone-api.git
-
Install dependencies
npm install
-
Create a new .env file with the following variables (see .env.example in the root folder). Replace the values with your values and local frontend PORT of choice
//Port number on which the server will run PORT=8080 //MySQL database connection settings DB_HOST=your_database_host DB_USER=your_database_user DB_PASSWORD=your_database_password DB_NAME=your_database_name //Session secret key for session management //You can enter any random string or word but to make it more secure you can generate one //generated by `node -e "console.log(require('crypto').randomBytes(32).toString('hex'));"` SESSION_SECRET=your_session_secret //GitHub Auth credentials GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret GITHUB_CALLBACK_URL=your_github_callback_url //Google Auth credentials GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret GOOGLE_CALLBACK_URL=your_google_callback_url //React App CLIENT_URL=http://localhost:5173
-
Open a new terminal window and start the backend server.
npm run start
-
Complete the instructions fom the front-end repo.
-
The application should now be running on http:https://localhost:5173 (frontend) and http:https://localhost:8080 (backend).
- Import the SQL file: Import the provided SQL file into your MySQL database. You can use a tool like MySQL Workbench or run the following command in your terminal:
mysql -u your_database_user -p your_database_name < path/to/your/sql/file.sql
- Configure Knex: Create a knexfile.js in the root directory with the following content:
import "dotenv/config";
import knex from "knex";
const db = knex({
client: "mysql2",
connection: {
host: process.env.DB_HOST,
database: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
charset: "utf8",
},
migrations: {
directory: "./migrations",
},
});
export default db;
- Run Migrations: Ensure you have configured your knexfile.js correctly. Then run:
npx knex migrate:latest
- Run Seeds: To populate the database with initial data, run:
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Lindsay Renna - [email protected]
Project Link: https://github.com/lindsay-renna/lindsay-renna-capstone-api
- [https://recommend.games](Markus Shepherd of recommend.games for the scraped boardgame data)