diff --git a/src/libs/db/postgres.js b/src/libs/db/postgres.js
index c60d28c6932491dbee5ba88a5f86412d707cda23..f63f95b703857799d564228fbbec69b603bed191 100644
--- a/src/libs/db/postgres.js
+++ b/src/libs/db/postgres.js
@@ -1,8 +1,22 @@
 const Sequelize = require('sequelize');
 
-// if you are using postgres, your DB URL will look like this
-const DATABASE_URL = 'postgres://postgres:postgres@localhost:5432/postgres'
+const dbConfig = {
+    database: 'simcaq_adm',
+    username: 'simcaq',
+    password: 'simcaq',
+    host: '200.17.202.97', 
+    port: 5432,        
+    dialect: 'postgres',
+  };
 
-const db = new Sequelize(DATABASE_URL)
+const db = new Sequelize(dbConfig)
+
+db.authenticate()
+    .then(() => {
+      console.log('Connection has been established successfully.');
+    })
+    .catch((err) => {
+      console.error('Unable to connect to the database:', err);
+    });
 
 module.exports = db
\ No newline at end of file
diff --git a/src/libs/models/activity.js b/src/libs/models/activity.js
index 92fc6f087fba744219badcd69ad7785b2d4b3b61..3db8be3c6ae564bd1648c7d58fb6b3a7d40682a2 100644
--- a/src/libs/models/activity.js
+++ b/src/libs/models/activity.js
@@ -21,7 +21,11 @@ var Activity = db.define("Activity",{
         type: Sequelize.STRING
     },
     date:{
-        type: Sequelize.STRING,
+        type: Sequelize.DATE,
+        allowNull:false
+    },
+    date_final:{
+        type: Sequelize.DATE,
         allowNull:false
     },
     authors:{
diff --git a/src/libs/models/publication.js b/src/libs/models/publication.js
index bd537bc0825b44a0e79d384e5bf631537784ef69..27a1a3a3f3dac90f3056d6e31caa144e17425477 100644
--- a/src/libs/models/publication.js
+++ b/src/libs/models/publication.js
@@ -61,6 +61,12 @@ var Publication = db.define("Publication",{
         type:Sequelize.BOOLEAN,
         allowNull: false,
         defaultValue: false
+    },
+    volume:{
+        type:Sequelize.STRING
+    },
+    pages:{
+        type:Sequelize.STRING
     }
 },{timestamp:true,
   createdAt: 'created_at',
diff --git a/src/libs/routes_v1/activity.js b/src/libs/routes_v1/activity.js
index 51ef67ea1ae60d35636dc42f3770f62b0fd9b29b..1c00ced76b5c2fddbed61d58d7b7966b0a172cec 100644
--- a/src/libs/routes_v1/activity.js
+++ b/src/libs/routes_v1/activity.js
@@ -28,16 +28,71 @@ function emailSyntax(email) {
 }
 
 activityApp.get('/', async (req, res, next) => {
-  const page = parseInt(req.query.page) || 1; 
-  const pageSize = parseInt(req.query.pageSize) || 5; 
-  try {
+  const ordenar = req.query.order || 'DESC';
+  const filter = req.query.filter || 'all';
+  const page = parseInt(req.query.page) || 1; // Current page number
+  const pageSize = parseInt(req.query.pageSize) || 5; // Number of items per page
+  if (filter === 'all') {
     const totalCount = await Activity.count();
     const offset = (page - 1) * pageSize;
 
     const acts = await Activity.findAll({
       offset,
       limit: pageSize,
-      order:[
+      order: [
+        ['date', ordenar],
+      ],
+    });
+
+    res.json({
+      page,
+      pageSize,
+      totalCount,
+      data: acts,
+    });
+  }
+  else {
+    const totalCount = await Activity.count({ where: { is_draft: filter } });
+    const offset = (page - 1) * pageSize;
+
+    const acts = await Activity.findAll({
+      offset,
+      limit: pageSize,
+      order: [
+        ['date', ordenar],
+      ],
+      where: {
+        is_draft: filter
+      }
+    });
+
+    res.json({
+      page,
+      pageSize,
+      totalCount,
+      data: acts,
+    });
+  }
+});
+
+activityApp.get('/drafts', async (req, res, next) => {
+  const page = parseInt(req.query.page) || 1;
+  const pageSize = parseInt(req.query.pageSize) || 5;
+  try {
+    const totalCount = await Activity.count({
+      where: {
+        is_draft: true
+      }
+    });
+    const offset = (page - 1) * pageSize;
+
+    const acts = await Activity.findAll({
+      offset,
+      limit: pageSize,
+      where: {
+        is_draft: true
+      },
+      order: [
         ['date', 'DESC']]
     });
 
@@ -53,44 +108,19 @@ activityApp.get('/', async (req, res, next) => {
   }
 });
 
-activityApp.get('/drafts', async (req, res, next) => {
-    const page = parseInt(req.query.page) || 1; 
-    const pageSize = parseInt(req.query.pageSize) || 5; 
-    try {
-      const totalCount = await Activity.count({where: {
-        is_draft: true
-      }});
-      const offset = (page - 1) * pageSize;
-  
-      const acts = await Activity.findAll({
-        offset,
-        limit: pageSize,
-        where: {
-          is_draft: true
-        },
-        order:[
-            ['date', 'DESC']]
-      });
-  
-      res.json({
-        page,
-        pageSize,
-        totalCount,
-        data: acts,
-      });
-    } catch (error) {
-      console.error(error);
-      res.status(500).json({ error: 'An error occurred' });
-    }
-  });
-
 activityApp.get('/:id', (req, res, next) => {
-    Activity.findByPk(req.params.id).then((act) => {
+  Activity.findByPk(req.params.id).then((act) => {
     if (!act) {
       res.statusCode = 404;
       res.json({ msg: "A atividade não está cadastrada" });
     } else {
-      req.result = act.toJSON();
+      let actJSON = act.toJSON();
+      //transform data yyyy-mm-dd to dd/mm/yyyy
+      let date = actJSON.date.split('-');
+      let date_headline = actJSON.date_headline.split('-');
+      actJSON.date = date[2] + '/' + date[1] + '/' + date[0];
+      actJSON.date_headline = date_headline[2] + '/' + date_headline[1] + '/' + date_headline[0];
+      req.result = actJSON;
       next();
     }
   }).catch(function (err) {
@@ -121,11 +151,11 @@ activityApp.post('/', passport.authenticate('bearer', { session: false }), autho
   console.log(req.body);
   let act = await Activity.create({
     id: 0,
-    type:req.body.tipo,
+    type: req.body.tipo,
     title: req.body.titulo,
     subtitle: req.body.subtitulo,
     date: transformDateFormat(req.body.dataDePostagem),
-    authors:req.body.autor,
+    authors: req.body.autor,
     text: req.body.texto,
     name_headline: req.body.nome,
     resume_headline: req.body.resumo,
@@ -145,7 +175,7 @@ activityApp.post('/', passport.authenticate('bearer', { session: false }), autho
     return res.json({ err, errors });
     // handle error;
   });
-  if(!act){
+  if (!act) {
     res.statusCode = 400;
     return res;
   }
@@ -169,19 +199,19 @@ activityApp.put('/:id', passport.authenticate('bearer', { session: false }), aut
     });
   }
   console.log("TEste");
-  act.type = req.body.type || act.type;
-  act.title = req.body.title || act.title;
-  act.subtitle = req.body.subtitle || act.subtitle;
-  act.date = req.body.date || act.date;
-  act.authors = req.body.autores || act.authors;
-  act.text= req.body.text || act.text;
-  act.name_headline= req.body.name_headline || act.name_headline;
-  act.resume_headline= req.body.resume_headline || act.resume_headline;
-  act.date_headline= req.body.date_headline || act.date_headline;
-  act.local_headline= req.body.local_headline || act.local_headline;
-  act.additional_headline= req.body.additional_headline || act.additional_headline;
-  act.is_draft= req.body.is_draft || act.is_draft;
-  act.is_headline= req.body.is_headline || act.is_headline;
+  act.type = req.body.tipo || act.type;
+  act.title = req.body.titulo || act.title;
+  act.subtitle = req.body.subtitulo || act.subtitle;
+  act.date = req.body.dataDePostagem || act.date;
+  act.authors = req.body.autor || act.authors;
+  act.text = req.body.texto || act.text;
+  act.name_headline = req.body.nome || act.name_headline;
+  act.resume_headline = req.body.resumo || act.resume_headline;
+  act.date_headline = req.body.dataAtividade || act.date_headline;
+  act.local_headline = req.body.local || act.local_headline;
+  act.additional_headline = req.body.informacoes || act.additional_headline;
+  act.is_draft = req.body.rascunho || act.is_draft;
+  //act.is_headline = req.body.is_headline || act.is_headline;
 
   act.save().catch(err => {
     if (err) {
@@ -190,17 +220,17 @@ activityApp.put('/:id', passport.authenticate('bearer', { session: false }), aut
     }
   })
   let activity = act.toJSON();
-  res.json({ activity: activity});
+  res.json({ activity: activity });
 
 });
 
 activityApp.delete('/:id', passport.authenticate('bearer', { session: false }), authorized('editar atividade'), async (req, res, next) => {
-  await Activity.destroy({where:{id:req.params.id}}).catch(function (err) {
+  await Activity.destroy({ where: { id: req.params.id } }).catch(function (err) {
     if (err) {
-        log.error(err);
-        return next({ err });
+      log.error(err);
+      return next({ err });
     }
-});
+  });
   return next({ msg: 'Activity Deleted', status: 200 });
 });
 
diff --git a/src/libs/routes_v1/publication.js b/src/libs/routes_v1/publication.js
index 45afc9cd4d57f727d91624465594a1826d084423..63a7cbd5b5683aaae12696f96079c7ae1177f193 100644
--- a/src/libs/routes_v1/publication.js
+++ b/src/libs/routes_v1/publication.js
@@ -30,15 +30,20 @@ function emailSyntax(email) {
 }
 
 pubApp.get('/', async (req, res, next) => {
+  const ordenar = req.query.order || 'DESC';
+  const filter = req.query.filter || 'all';
   const page = parseInt(req.query.page) || 1; // Current page number
   const pageSize = parseInt(req.query.pageSize) || 5; // Number of items per page
-  try {
+  if (filter === 'all') {
     const totalCount = await Publication.count();
     const offset = (page - 1) * pageSize;
 
     const publis = await Publication.findAll({
       offset,
       limit: pageSize,
+      order: [
+        ['created_at', ordenar],
+      ],
     });
 
     res.json({
@@ -47,43 +52,92 @@ pubApp.get('/', async (req, res, next) => {
       totalCount,
       data: publis,
     });
-  } catch (error) {
-    console.error(error);
-    res.status(500).json({ error: 'An error occurred' });
   }
-});
+  else {
+    const totalCount = await Publication.count({ where: { is_draft: filter } });
+    const offset = (page - 1) * pageSize;
 
-pubApp.get('/drafts', async (req, res, next) => {
-  const page = parseInt(req.query.page) || 1; // Current page number
-  const pageSize = parseInt(req.query.pageSize) || 5; // Number of items per page
+    const publis = await Publication.findAll({
+      offset,
+      limit: pageSize,
+      order: [
+        ['created_at', ordenar],
+      ],
+      where: {
+        is_draft: filter
+      }
+    });
 
-  try {
-    // Count total number of items
-    const totalCount = await Publication.count({ where: {
-      is_draft: true
-    }});
+    res.json({
+      page,
+      pageSize,
+      totalCount,
+      data: publis,
+    });
+  }
+});
+
+pubApp.get('/homepage', async (req, res, next)=> {
+  const totalCount = await Publication.count({ where: { is_headline: true } });
+  const offset = (page - 1) * pageSize;
+  const publis = await Publication.findAll({
+    offset,
+    limit: pageSize, 
+    order: [
+      ['created_at', ordenar],
+    ],
+    where:{
+      is_headline:true
+    }
+  });
+  res.json({
+    page,
+    pageSize,
+    totalCount,
+    data: publis,
+  });
+});
 
-    // Calculate offset based on page and pageSize
+pubApp.get('/type/:tp', async (req, res, next) => {
+  const tp = req.params.tp || 'all';
+  if(tp === 'all'){
+    const totalCount = await Publication.count();
     const offset = (page - 1) * pageSize;
 
-    // Query the database with pagination options
-    const drafts = await Publication.findAll({
+    const publis = await Publication.findAll({
       offset,
       limit: pageSize,
+      order: [
+        ['created_at', ordenar],
+      ],
+    });
+
+    res.json({
+      page,
+      pageSize,
+      totalCount,
+      data: publis,
+    });
+  }
+  else{
+    const totalCount = await Publication.count({ where: { filter: req.params.tp } });
+    const offset = (page - 1) * pageSize;
+    const publis = await Publication.findAll({
+      offset,
+      limit: pageSize,
+      order: [
+        ['created_at', ordenar],
+      ],
       where: {
-        is_draft: true
+        filter: req.params.tp
       }
     });
-
     res.json({
       page,
       pageSize,
       totalCount,
-      data: drafts,
+      data: publis,
     });
-  } catch (error) {
-    console.error(error);
-    res.status(500).json({ error: 'An error occurred' });
   }
 });
 
@@ -91,12 +145,13 @@ pubApp.get('/drafts', async (req, res, next) => {
 pubApp.get('/:id', async (req, res, next) => {
   let pb = await Publication.findByPk(req.params.id).catch(function (err) {
     log.error(err);
-    return next(err);}
+    return next(err);
+  }
   );
   if (!pb) {
-      res.statusCode = 404;
-      res.json({ msg: "A publicação não está cadastrada" });
-    } 
+    res.statusCode = 404;
+    res.json({ msg: "A publicação não está cadastrada" });
+  }
   else {
     let publ = pb.toJSON();
     publ.Filename = null;
@@ -104,20 +159,21 @@ pubApp.get('/:id', async (req, res, next) => {
       log.error(err);
       return next(err);
     });
-    if(file_){
+    if (file_) {
       publ.Filename = file_.name;
-      }
+    }
     req.result = publ;
     next();
-    }
-  }, response('publication'));
+  }
+}, response('publication'));
 
 pubApp.post('/', passport.authenticate('bearer', { session: false }), authorized('criar publicacao'), upload.single('file'), async (req, res, next) => {
   let _file_id = null
-  if(req.file){
+  if (req.file) {
     _file_id = await fileWorker.uploadFile(req.file);
-    if(!_file_id)
-      console.log("NAO ARQUIVO");}
+    if (!_file_id)
+      console.log("NAO ARQUIVO");
+  }
   let data = JSON.parse(req.body.data);
   let pb = await Publication.create({
     id: 0,
@@ -130,7 +186,9 @@ pubApp.post('/', passport.authenticate('bearer', { session: false }), authorized
     link: data.link,
     upload: _file_id,
     is_draft: data.rascunho,
-    is_homepage: data.homepage
+    is_homepage: data.homepage,
+    volume: data.volume,
+    pages: data.pagina
   }).catch(function (err) {
     log.error(err);
     let errors = [];
@@ -148,60 +206,53 @@ pubApp.post('/', passport.authenticate('bearer', { session: false }), authorized
 
 pubApp.post('/edit', passport.authenticate('bearer', { session: false }), authorized('editar publicacao'), upload.single('file'), async (req, res, next) => {
   let _file_id = null
-  if(req.file){
+  if (req.file) {
     _file_id = await fileWorker.uploadFile(req.file);
-    if(!_file_id)
-      console.log("NAO ARQUIVO");}
+    if (!_file_id)
+      console.log("NAO ARQUIVO");
+  }
   let data = JSON.parse(req.body.data);
   console.log(data);
-  req.response = {'This is a test':'This is a test'};
-  next();
-}, response('publication'));
+  let pb = await Publication.findByPk(data.id).catch(function (err) {
+    log.error(err);
+    return next(err);
+  });
+  pb.filter = data.categoria || pb.filter;
+  pb.title = data.title || pb.title;
+  pb.authors = data.autores || pb.authors;
+  pb.organization = data.organizacao || pb.organization;
+  pb.year = data.ano || pb.year;
+  pb.text = data.texto || pb.text;
+  pb.link = data.link || pb.link;
+  pb.is_homepage = data.homepage || pb.is_homepage;
+  pb.is_draft = data.rascunho || pb.is_draft;
+  pb.upload = _file_id || pb.upload;
+  pb.volume = data.volume || pb.volume;
+  pb.pages = data.pagina || pb.pages;
 
-pubApp.put('/edit/:id', passport.authenticate('bearer', { session: false }), authorized('editar publicacao'), async (req, res, next) => {
-  console.log(req);
-  let pb = await Publication.findByPk(req.params.id).catch(function (err) {
-    if (err) {
-      log.error(err);
-      return next({ err });
-    }
-  })
-  if (!pb) {
-    res.statusCode = 404;
-    return next({
-      err: {
-        message: 'Publicação não encontrada'
-      }
-    });
-  }
-  pb.filter = req.body.categoria || pb.filter;
-  pb.title = req.body.title || pb.title;
-  pb.authors = req.body.autores || pb.authors;
-  pb.organization= req.body.organizacao || pb.organization;
-  pb.year= req.body.ano || pb.year;
-  pb.text= req.body.texto || pb.text;
-  pb.link= req.body.link || pb.link;
-  pb.upload= req.body.upload || pb.upload;
-  pb.is_homepage= req.body.homepage || pb.is_homepage;
-  console.log(pb);
-  pb.save().catch(err => {
-    if (err) {
-      log.error(err);
-      return next({ message: 'Erro ao atualizar publicacao' });
+  pb.save().catch(function (err) {
+    log.error(err);
+    let errors = [];
+    for (let errName in err.errors) {
+      errors.push(err.errors[errName].message);
     }
-  })
-  let p = pb.toJSON();
-  res.json({ publication: p });
+    log.error(errors);
+    res.statusCode = 400;
+    return res.json({ err, errors });
+    // handle error;
+  });
 
-});
+  req.result = pb.toJSON();
+  next();
+}, response('publication'));
 
 pubApp.delete('/:id', passport.authenticate('bearer', { session: false }), authorized('apagar publicacao'), async (req, res, next) => {
-  await Publication.destroy({where:{id:req.params.id}}).catch(function (err) {
+  await Publication.destroy({ where: { id: req.params.id } }).catch(function (err) {
     if (err) {
-        log.error(err);
-        return next({ err });
+      log.error(err);
+      return next({ err });
     }
-});
+  });
   return next({ msg: 'Publication Deleted', status: 200 });
 });