-
Notifications
You must be signed in to change notification settings - Fork 11
Routes and APIs
Song Zheng edited this page May 28, 2020
·
7 revisions
We need the following routes and API endpoints to power the following pages:
- Landing
- Login
- Signup
- Email Confirmation
- Database Setup
- Databases
The follow routes would be needed to power the pages above
Renders the login page
Renders the signup page
- Renders landing page if user is not logged in
- Renders render email confirmation page if user has not confirmed email.
- Renders database setup page if user has not created a database password.
- Renders the databases page
Destroys user's session cookies and redirects to /
landing page.
APIs you need
Used by:
- Login Page
passwords are base64 encoded so that if engineers are debugging something in production, they don't accidentally see each other's password.
{
email: '[email protected]',
password: 'base64 encoded password'
}
{
status: 'success'
}
{
error: {
messages: ["username / password combination is not valid"]
}
}
Used by
{
username: 'username',
password: 'base64 encoded password',
email: '[email protected]'
}
{
status: 'success'
}
{
error: {
message: ["username is taken", "password is too short", "email is invalid"]
}
}
Used by
- Reset Password Email - Send Password Reset Email
{
type: 'email',
category: 'resetPassword',
email: '[email protected]'
}
{
status: 'success'
}
{
error: {
message: 'Email delivery failed. Please try again.'
}
}
This updates the user with a database password for that user to use to create all databases.
Used By
{
password: 'base64 encoded password'
}
{
status: 'success'
}
{
error: {
message: 'database setup failed'
}
}
Create a database for the currently logged in user
Used by:
base64 encoded JSON string
{
name: 'postgres'
}
{
status: 'success'
}
{
error: {
message: 'failed to create database'
}
}
Get all databases for the currently logged in user.
Used by:
{
data: [{postgres: {connectionInfo:{...}}}, {mongoDB: {connectionInfo:{...}}, {neo4J: {connectionInfo: null}}}]
}
{
error: {
message: 'failed to get databases'
}
}