An App that let's you track your clients subscriptions
The front is developed with React and the back is an Express.js server with socket.io for the chat and comunication.
It's an app made for companies that sell monthly subscriptions!
You can create your company, clients and subscriptions to manage all of the economic information related to your service, but also it counts with a live chat so you and your clients can keep in touch in a much more professional enviroment.
The company can register their plans (monthly) and extras (daily) services to make ir more custom to the fit.
To create a company you just have to submit your email and your company name, later you will recieve an email with a link to confirm your subscription!
Every time you submit the creation of a new user we will generate a secure token to make sure their email is the one is submitted by the company. The creation of any client or local users are perform in similar manners as of the creation of the company.
The different collections are shown 👇🏻
There are two types of users: Locals (managers or workers of the company) and Clients.
Their basic structure is shown here:
Local
(
{
username: { type: String, unique: true, required: true },
password: { type: String, required: true },
name: {
first: { type: String },
last: { type: String },
},
type: {
type: String,
enum: ['admin', 'coordinator'],
},
company: { type: ObjectId, ref: 'company' },
},
{
timestamps: true,
}
);
Clients
(
{
username: { type: String, unique: true, required: true }, //email
password: { type: String, required: true },
name: {
first: { type: String },
last: { type: String },
},
subscriptions: [{ type: ObjectId, ref: 'subscription' }],
company: { type: ObjectId, ref: 'company' },
phone: { prefix: Number, phone: Number },
},
{
timestamps: true,
}
);
The client user have aditional fields to help the payment tracking!
Plan and extras are alike, they differ only where the times of money tracking comes in!
(
{
name: { type: String, required: true },
company: { type: ObjectId, ref: 'company' },
price: { price: { type: String, required: true }, currency: String },
active: { type: Boolean, default: true }
},
{
timestamps: true
}
);
The subscriptions are directly linked to the clients, they are who recieve the plans and extras. Meanwhile the clients recieve subscriptions to make it easier to manage the info!
(
{
name: String,
parents: [{ type: ObjectId, ref: 'clientUser' }],
company: { type: ObjectId, ref: 'company' },
plans: [
{
plan: { type: ObjectId, ref: 'plan' },
startDate: { type: Date, default: Date.now },
endDate: Date,
charged: { type: Boolean, default: false },
timesCharged: { type: Number, default: 0 }
}
],
extras: [
{
extra: { type: ObjectId, ref: 'extra' },
date: { type: Date, default: Date.now },
charged: { type: Boolean, default: false }
}
],
level: String,
active: { type: Boolean, default: true }
},
{
timestamps: true
}
);
The implementation of JWT has made possible the secure user creation and password reset.
- Make a global statictic of the company
- Add client payment support directly to company
All of the ideas are welcome!
Please refer to LICENSE.md
If you want to contribute to this project, please refer to CONTRIBUTING.md
Author: Luis Miguel Feijoo