Implementation and Docs deployed at REFRESH DOCS
Students and working professionals can experience tunnel vision when working towards an important goal, like labs, and this often leads to low energy, motivation, and sometimes complete burnout.
Those in the tech industry are always looking for ways to optimize their output - Refresh looks to accelerate healthy habits by tracking key metrics in a way that makes things fresh and fun so that individuals can optimize their daily output and maintain a healthy lifestyle.
The Back-End uses Postgres as it's database, since the DB sits outside vscode you will need a way to connect to the DB from VsCode.
- Download Postgres https://www.postgresql.org/ (it will install pgAdmin4) (the default port is 5432). The default username is "postgres", remember the password you set in the installer. You will need it later.
- Open pgAdmin4 on your computer. pgAdmin4 will ask for a master password, this is the password you set when creating an account in the installer
- Top Left Click "Servers()", pgAdmin4 will most likely ask for another password, which should be the one you made during the installer or "1234"
- After you click on Servers you'll see that the default database is called "postgres"
- If you click on Schemas at the bottom you can see any schemas you migrated
- install dotenv and create a .env file, make sure it sits at the root level.
- Look inside the knexfile.js. You'll notice that under development the connection is set to an environment variable.
- Please ask your TL for .env information from the previous labs. A google drive of passwords and secrets will be provided.
Method | URL | Description | Requirements |
---|---|---|---|
POST | /users/login | Log In as User | email , password |
POST | /users/register | Register A New User | email, full name, password |
GET | /users/:id/metrics | See User's Metrics | |
PUT | /users/:id/metrics | Edit User's Metrics | water, exercise, sleep, breaks |
GET | /users | get all users | |
PUT | /users/:id | UPDATE user | email, password, full name |
GET | /users/:id | get user by id | user id |
GET | /teams | See List of All Teams | |
GET | /teams/:id | See Team by Id | team id |
POST | /teams | POST to add a team | |
DEL | /teams/:id | DELETE to delete a team by ID | |
DEL | /users/:id | DELETE to delete a user by ID |
Method | URL | Description | Requirements |
---|---|---|---|
POST | /admin/register | ADMIN REGISTER | { "email": "admin2@gmail.com", "password: "admin" } |
POST | /admin/login | ADMIN LOGIN | { "email": "admin2@gmail.com", "password: "admin" } |
{
email: "example@gmail.com",
password: "example123",
}
{
email: "example@gmail.com",
full_name: "Example Name",
password: "example123",
avatar: null,
points: 5,
team_id: 1
}
{
email: "example@gmail.com",
password: "example123",
}
{
"water": 123,
"exercise": 123,
"breaks": 1234,
"sleep": 0
}
This project is licensed under the MIT License - see the LICENSE.md file for details