Writing a simple blog server on node.js/express/mongodb
The front is not needed.
You only need a backen and appi to communicate with him.
Required authorization through jwt (register/autorization/logout)
Required categories simple (add/editing/deleting)
Required blog content (add/editing/deleting)
Images need to be downloaded and optimized according to the specific parameters.
...All
1 .Use the following plugins of the latest version of npm:
Express
Config
The Mongoose
The rest are discussed separately.
All in JSON format
A successful answer is always OK: 1
Not successful always has an error field, if there is a text error then this is the way.
{error: {msg: 'text error'}}
If any field is incorrectly filled, the answer is this.
by {
The error: {
The data: {
The title: {
msg: 'Title is wrongly filled',
and the
The password: {
msg: 'You need to fill in a password',
and the
and the
msg: 'General error message',
and the
The
2ndAuthorization of :
User Model
Email: {type: String, require: true, unique: true},
Password: {type: String, require: true}
articles: [{type: Types.ObjectId, ref: 'Article'}],
by API:
Post: /api/auth/registration (e-mailpassword)
Check if the email is email
The password must be more than 8 characters.
Examples of Answer: {ok: 1}
{error: {msg: 'Email is busy'}}
Post: /api/auth/login (e-mail address password)
if successful authorization to reply we send jwt token and id/email user
{Token: ‘...’,userId: 'Animal from Mongo', userEmail: 'xxxx'}
ThreeCategories Categories
Title: {type: String, require: true}
Code: {type: String, require: true, unique: true}
isRemoved: {type: Boolean, default: false}
articles: [{type: Types.ObjectId, ref: 'Article'}],
API: (all apps require verification that the user is authorized)
GET: /api/category/list
{category: [{id: 'xx', code: 'xx', title: 'xxx'}
POST: /api/category/add (code
The title must be
{category: {id: 'xx', code: 'xx', title: 'xxx'}}
POST: /api/category/edit/:idcategory (code
Post: /api/category/remove/:idcategory
...analogically upper app without checking (changes only the field isRemoved = true)
Post: /api/category/recover/:idcategory
...analogically app above without checks (changes only the field isRemoved = false)
4 .Blog MaterialsModel of Blog Materials
Title: {type: String, require: true}
Code: {type: String, require: true, unique: true}
mainImage: {type: String}
shortDescr: {type: String}
and the string,
owner: {type: Types.ObjectId, ref: 'User'}
Category: {type: Types.ObjectId, ref: 'Category'}
isRemoved: {type: Boolean, default: false}
... similar app to the list of materials/adding/editing/deleting/restore
I will send a little more detail to the executive.
and 5.Download imagesApply with verification on authorization, the file comes to check it on size and on what it is png or jpg
If png is converted to jpg
Preserve the original image
to optimize the image (I used the image plugin) to return the image link to the app
Style of code:
1 .Displacement in Two Displaces
2ndAt the end of the line; not put
Client's review of cooperation with freelancer
Writing a simple blog server on node.js/express/mongodbEverything is great! Everything is great! Everything is great! Everything is great!
![]()
Freelancer's review of cooperation with client
Writing a simple blog server on node.js/express/mongodbОтличный заказчик, с хорошо поставленными задачами.
![]()
-
Возьмите в использование CMS https://keystonejs.com/ будет быстрее чем с нуля. Намного
-
Стиль кода:
1. Отступы в два пробела
2. В конце строчек ; не ставить
За это прям респект! 🙂
-
Current freelance projects in the category Javascript and Typescript
Development of an interactive Palworld map for the websiteWe need to develop an interactive map for Palworld based on the example: https://palworld.gg/map We need not just a static image, but a full-fledged interactive map where users can view locations, toggle object categories on/off, search for specific points, and interact with… HTML & CSS, Javascript and Typescript ∙ 4 hours 30 minutes back ∙ 13 proposals |
Development of the AM Mobility platform (car service, parking, insurance, car rental)
5786 USD
We are looking for a team or an experienced Full Stack developer to create the MVP of the AM Mobility platform. AM Mobility is a unified digital ecosystem for motorists, combining in one application and web platform: parking; car service; tire fitting; car wash; car rental;… Javascript and Typescript, Web Programming ∙ 5 days 10 hours back ∙ 114 proposals |
Gsap animations
22 USD
Good day. Corrections need to be made in the current project. A specialist is needed who works well with gsap/lenis. Animation of cards needs to be done. Detailed specifications here:… Javascript and Typescript, Web Programming ∙ 5 days 16 hours back ∙ 21 proposals |
I am looking for a mentor with Claude Code to launch a web project from scratch.Brief about the task: I am a beginner with no programming experience. I have a ready specification for website development (42 pages, Next.js, PostgreSQL). I want to implement it myself using Claude Code - I need a specialist who will set up the environment and teach me how to… Javascript and Typescript, Tuition ∙ 7 days 15 hours back ∙ 20 proposals |
Website design updateIt is necessary to update the design of the existing website using HTML, CSS, JS: refresh the appearance, make it modern and responsive for mobile devices. Smooth animations and interactive elements need to be added. HTML & CSS, Javascript and Typescript ∙ 8 days 9 hours back ∙ 97 proposals |